<template>
	<text class="noDataViewTip" v-if="!hideNoData">暂无数据</text>
	<uni-list :border="true">
		<uni-list-item
			v-for="(item,index) in buildingList"
			:key="index"
			:title="item.buildingName"
			:note="'地址：'+item.buildingDetailAddress"
			:clickable="true"
			:right-text="item.distanceString"
			@click="chooseBuilding(item)">
		</uni-list-item>
	</uni-list>
</template>

<script>
	import { getSupplierList } from "@/API/home.js"
	export default {
		data() {
			return {
				
				buildingList: [], // 大厦数据
				currentBuild: '', // 当前定位的大楼
				hideNoData: false
			}
		},
		onLoad(options) {
			if (options.buildInfo) {
				this.buildingList = JSON.parse(options.buildInfo)
				this.hideNoData = this.buildingList && this.buildingList.length > 0
			}
		},
		methods: {
			chooseBuilding(buildingObj) {
				uni.$emit('changeBuilding', {data: buildingObj})
				this.back()
			},
			back() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>